﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Windows;
using Deepforest.TweetMe.UI.Properties;

namespace Deepforest.TweetMe.UI
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : Application
    {
        protected override void OnStartup(StartupEventArgs e)
        {
            ShutdownMode = ShutdownMode.OnMainWindowClose;
            var mainWindow = new MainWindow();
            MainWindow = mainWindow;

            if (string.IsNullOrEmpty(Settings.Default.UserName) ||
                string.IsNullOrEmpty(Settings.Default.Password))
            {
                var settingsDialog = new SettingsDialog();
                if (settingsDialog.ShowDialog() == false)
                {
                    Shutdown(0);
                    return;
                }                
            }
            
            
            mainWindow.Show();

            base.OnStartup(e);
        }
    }
}
